package com.aboverock.core.token;

import org.apache.shiro.authc.AuthenticationToken;

/**
 * 将系统token封装成TokenLoginToken登录另一系统.
 *
 * @author Rock Wang
 */
public class TokenLoginToken implements AuthenticationToken {
    private static final long serialVersionUID = 1L;

    private String token;

    public TokenLoginToken(String token) {
        this.token = token;
    }

    @Override
    public Object getPrincipal() {
        return token;
    }

    @Override
    public Object getCredentials() {
        return Boolean.TRUE;
    }

    @Override
    public String toString() {
        return token;
    }

}
